package com.situ.science.service.impl;


import com.situ.science.mapper.AdminMapper;
import com.situ.science.pojo.Admin;
import com.situ.science.pojo.dto.PasswordDto;
import com.situ.science.service.IAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements IAdminService {
    @Autowired
    private AdminMapper adminMapper;
    @Override
    public Admin login(Admin admin) {
        return adminMapper.login(admin);
    }

    @Override
    public Admin info(Integer id) {
        return adminMapper.info(id);
    }

    @Override
    public void update(Admin admin) {
        adminMapper.update(admin);
    }

    @Override
    public void resetPassword(PasswordDto passwordDto , Integer id) {
        adminMapper.resetPassword(passwordDto, id);
    }

    @Override
    public String checkPassword(String oldPassword, Integer id) {
        return adminMapper.checkPassword(oldPassword,id);
    }
}
